home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
os2
/
vsoup11.zip
/
nntpcl.hh
< prev
next >
Wrap
Text File
|
1996-09-02
|
3KB
|
89 lines
// $Id: nntpcl.hh 1.10 1996/09/02 13:29:00 hardy Exp $
//
// This progam/module was written by Hardy Griech based on ideas and
// pieces of code from Chin Huang (cthuang@io.org). Bug reports should
// be submitted to rgriech@ibm.net.
//
// This file is part of soup++ for OS/2. Soup++ including this file
// is freeware. There is no warranty of any kind implied. The terms
// of the GNU Gernal Public Licence are valid for this piece of software.
//
#ifndef __NNTPCL_HH__
#define __NNTPCL_HH__
#include <assert.h>
#include <stdio.h>
#include "socket.hh"
//--------------------------------------------------------------------------------
//
// Diverse NNTP-Fkts zur Klasse zusammengefaßt
//
// Problem dieser Klasse ist:
// - die Zustände können/müssen von extern gesetzt werden
//
class TNntp: private TSocket {
public:
enum Res { nok,ok,killed,notavail }; // nok must be 0, ok 1
public:
TNntp( void );
~TNntp();
TNntp( const TNntp &right ); // copy constructor not allowed !
operator = (const TNntp &right); // assignment operator not allowed !
void setHelper( void (*xref)(const char *xrefLine),
int (*killQ)(const char *groupName, const char *headerLine) );
Res open( const char *nntpServer, const char *nntpUser, const char *nntpPasswd );
void close( int sendQuit=1 );
int isReadOnly( void ) { return readOnly; }
Res getNewGroups( const char *nntpTimeFile, int changeFile );
Res getOverview( long first, long last );
Res setActGroup( const char *grpname, long &Cnt, long &lo, long &hi);
Res nextArticle( long *next );
Res postArticle( FILE *inf, size_t bytes );
Res getArticle( void );
FILE *getTmpF( void ) { assert( tmpF != NULL ); return tmpF; }
void selectArticle( const char *grpname, long artNum=-1, int doKill=0 );
long article( void ) { return selArticle; }
long nntpArticle( void ) { return selNntpArticle; }
const char *groupName( void ) { return selGroup; }
const char *getLastErrMsg( void );
static long getBytesRcvd( void );
private:
int readOnly;
FILE *tmpF;
char *tmpN;
const char *actGroup; // group activated at nntp server
const char *selGroup;
long selArticle;
long selNntpArticle;
long nntpGroupHi;
int killEnabled;
char lastErrMsg[1000]; // buffer for last error msg
const char *user;
const char *passwd;
void (*xrefHook)( const char *xrefLine ); // hook for xref processing
int (*killQHook)( const char *groupName, // hook for killfile processing
const char *headerLine );
Res request( const char *request, char *reply, size_t replySize, int expReply );
Res _getHead( void );
Res _getBody( void );
};
#endif // __NNTPCL_HH__